package com.by;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * @author ServivE
 * @version 0.1
 * @className Consumer
 * @description
 * @date 2024/10/23 9:29
 * @since jdk17
 */
@Component
public class Consumer {
    /**
     * 监听队列hello里的消息
     *
     * @param message
     */
    @RabbitListener(queues = {"hello"})
    public void handler(Message message) {
        System.out.println("消费者消费:" + new String(message.getBody()));
    }
}
